//
//  UIView+Shadow.m
//  WelfareManager
//
//  Created by longmin on 17/1/14.
//  Copyright © 2017年 timtian. All rights reserved.
//

#import "UIView+Shadow.h"

@implementation UIView (Shadow)

- (void)lm_shadowWithX:(CGFloat)x y:(CGFloat)y opacity:(CGFloat)opacity radius:(CGFloat)radius {
    self.layer.shadowColor = [UIColor blackColor].CGColor;
    self.layer.shadowOffset = CGSizeMake(x, y);
    self.layer.shadowOpacity = opacity;
    self.layer.shadowRadius = radius;
}

- (void)lm_shadowBorderWithOpacity:(CGFloat)opacity radius:(CGFloat)radius {
    if (IS_IPHONE_4_OR_LESS) {
        return;
    }
    
    self.layer.shadowColor = [UIColor blackColor].CGColor;
    self.layer.shadowOpacity = opacity;
    self.layer.shadowRadius = radius;
    
    UIBezierPath *path = [UIBezierPath bezierPathWithRect:self.bounds];
    
    
    self.layer.shadowPath = (__bridge CGPathRef _Nullable)(path);
    
}

@end
